From aef593a3baed707a4d7c0ad6335b4d20a5e5af84 Mon Sep 17 00:00:00 2001 From: Maximilian Engelhardt Date: Wed, 18 Jan 2023 23:02:07 +0100 Subject: [PATCH] debian: split debug files out of xen-hypervisor-V-F and xen-utils-V The debug files have grown in size over time and can no longer be considered small. So we now ship them uncompressed in new -dbg packages. The files are installed into /usr/lib/debug at the same path as the binaries they correspond to, as described in the "Best practices for debug packages" (Section 6.8.9) in the Debian Developer's Reference. Signed-off-by: Maximilian Engelhardt --- debian/control | 34 +++++++++++++++++++ debian/rules | 21 ++++++++---- debian/source/lintian-overrides | 5 +++ debian/xen-hypervisor-V-F-dbg.install.vsn-in | 3 ++ debian/xen-hypervisor-V-F.install.vsn-in | 4 --- ...en-hypervisor-V-F.lintian-overrides.vsn-in | 4 --- debian/xen-utils-V-dbg.install.vsn-in | 3 ++ debian/xen-utils-V.install.vsn-in | 3 -- 8 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 debian/source/lintian-overrides create mode 100644 debian/xen-hypervisor-V-F-dbg.install.vsn-in delete mode 100644 debian/xen-hypervisor-V-F.install.vsn-in delete mode 100644 debian/xen-hypervisor-V-F.lintian-overrides.vsn-in create mode 100644 debian/xen-utils-V-dbg.install.vsn-in diff --git a/debian/control b/debian/control index abf7256dd5..906b6a4013 100644 --- a/debian/control +++ b/debian/control @@ -114,6 +114,16 @@ Description: Xen administrative tools qemu-utils and seabios are needed for "Xen HVM" (amd64) Built-Using: ${misc:Built-Using} +Package: xen-utils-4.17-dbg +Section: debug +Architecture: amd64 arm64 armhf +Priority: optional +Depends: xen-utils-4.17 (= ${binary:Version}), ${misc:Depends} +Description: debug symbols for xen-utils-4.17 + This package provides debug symbols for the xen-utils binaries as well as + detached debug symbols for the `shim' used for booting PV guests in an HVM + container. + Package: xen-hypervisor-4.17-amd64 Section: kernel Architecture: amd64 @@ -125,6 +135,14 @@ Description: Xen Hypervisor on AMD64 loader and controls cpu and memory, sharing them between your administrative domain (Domain 0) and the virtual guest systems. +Package: xen-hypervisor-4.17-amd64-dbg +Section: debug +Architecture: amd64 +Priority: optional +Depends: xen-hypervisor-4.17-amd64 (= ${binary:Version}), ${misc:Depends} +Description: debug symbols for Xen Hypervisor on AMD64 + This package provides the detached debug symbols for the Xen hypervisor. + Package: xen-system-amd64 Section: admin Architecture: amd64 @@ -145,6 +163,14 @@ Description: Xen Hypervisor on ARM64 loader and controls cpu and memory, sharing them between your administrative domain (Domain 0) and the virtual guest systems. +Package: xen-hypervisor-4.17-arm64-dbg +Section: debug +Architecture: arm64 +Priority: optional +Depends: xen-hypervisor-4.17-arm64 (= ${binary:Version}), ${misc:Depends} +Description: debug symbols for Xen Hypervisor on ARM64 + This package provides the detached debug symbols for the Xen hypervisor. + Package: xen-system-arm64 Section: admin Architecture: arm64 @@ -165,6 +191,14 @@ Description: Xen Hypervisor on ARMHF loader and controls cpu and memory, sharing them between your administrative domain (Domain 0) and the virtual guest systems. +Package: xen-hypervisor-4.17-armhf-dbg +Section: debug +Architecture: armhf +Priority: optional +Depends: xen-hypervisor-4.17-armhf (= ${binary:Version}), ${misc:Depends} +Description: debug symbols for Xen Hypervisor on ARMHF + This package provides the detached debug symbols for the Xen hypervisor. + Package: xen-system-armhf Section: admin Architecture: armhf diff --git a/debian/rules b/debian/rules index 7a83411672..d16b236f66 100755 --- a/debian/rules +++ b/debian/rules @@ -301,24 +301,33 @@ override_dh_installinit: dh_installinit --name xen --no-start -- defaults dh_installinit --name xendomains --no-start -- defaults +# We want to ship xen-shim-syms in a -dbg package, but if we just add a +# xen-utils-V-dbg package for it, lintian will complain with the following +# warning: +# W: xen changes: package-builds-dbg-and-dbgsym-variants xen-utils-V-dbg xen-utils-V-dbgsym +# So we disable the generation of an automatic dbgsym packages for xen-utils-V +# and ship the automatically generated files in our xen-utils-V-dbg package. +# # Don't strip the .note section from xen-shim. See also # debian/xen-utils-V.lintian-overrides.vsn-in +# +# Finally, don't strip anything in the -dbg packages override_dh_strip: - dh_strip --exclude=xen-shim + dh_strip --package=xen-utils-$(upstream_version) \ + --dbg-package=xen-utils-$(upstream_version)-dbg \ + --exclude=xen-shim + dh_strip --remaining-packages \ + --no-package=xen-utils-$(upstream_version)-dbg \ + --no-package=xen-hypervisor-$(upstream_version)-$(flavour)-dbg # Hardlink the various xenstore-* programs together. This is an # argv[0]-using binary of which we can have only one copy. We need to # do this late, because dh_strip breaks hardlinks. -# -# The debug files are fairly large, fairly rarely used, -# and not compressed by the upstream build system. override_dh_compress: rdfind -makehardlinks true -makeresultsfile false \ debian/xenstore-utils/usr/bin : dh_compress -Xusr/share/doc/xen/html - find debian/xen-hypervisor-*/usr/lib/debug -type f -print0 \ - | xargs -0r gzip -9vn # We are dropping the config file /etc/default/xen which appeared in # earlier versions. See ./ucf-remove-fixup for more details. diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 0000000000..c7687b227e --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,5 @@ +# We install the hypervisor and shim debug files in our own -dbg packages. +# Those files are not installed by the automatic -dbgsym packages, so we can't +# use these. +xen source: debian-control-has-obsolete-dbg-package *xen-hypervisor-*-dbg* +xen source: debian-control-has-obsolete-dbg-package *xen-utils-*-dbg* diff --git a/debian/xen-hypervisor-V-F-dbg.install.vsn-in b/debian/xen-hypervisor-V-F-dbg.install.vsn-in new file mode 100644 index 0000000000..071155ae5a --- /dev/null +++ b/debian/xen-hypervisor-V-F-dbg.install.vsn-in @@ -0,0 +1,3 @@ +usr/lib/debug/xen* usr/lib/debug/boot/ +# ^ The xen* wildcard excludes the shim symbols. The shim is treated +# as part of the toolstack - see xen-utils-V-dbg.install.vsn-in. diff --git a/debian/xen-hypervisor-V-F.install.vsn-in b/debian/xen-hypervisor-V-F.install.vsn-in deleted file mode 100644 index a211b1d9ac..0000000000 --- a/debian/xen-hypervisor-V-F.install.vsn-in +++ /dev/null @@ -1,4 +0,0 @@ - -usr/lib/debug/xen* usr/lib/debug/ -# ^ The xen* wildcard excludes the shim symbols. The shim is treated -# as part of the toolstack - see xen-utils-V.install.vsn-in. diff --git a/debian/xen-hypervisor-V-F.lintian-overrides.vsn-in b/debian/xen-hypervisor-V-F.lintian-overrides.vsn-in deleted file mode 100644 index e8ea833200..0000000000 --- a/debian/xen-hypervisor-V-F.lintian-overrides.vsn-in +++ /dev/null @@ -1,4 +0,0 @@ -# Aas is traditional for kernels too, we ship the debug information -# in the hypervisor package rather than creating yet another -# package just for this file, which is only 50K or so anyway. -debug-suffix-not-dbg *usr/lib/debug/xen-*.efi.map.gz* diff --git a/debian/xen-utils-V-dbg.install.vsn-in b/debian/xen-utils-V-dbg.install.vsn-in new file mode 100644 index 0000000000..d7a89c043b --- /dev/null +++ b/debian/xen-utils-V-dbg.install.vsn-in @@ -0,0 +1,3 @@ +? flavour = amd64 +usr/lib/debug/usr/lib/xen-*/boot/* +? diff --git a/debian/xen-utils-V.install.vsn-in b/debian/xen-utils-V.install.vsn-in index da04b59d42..977bd8025b 100644 --- a/debian/xen-utils-V.install.vsn-in +++ b/debian/xen-utils-V.install.vsn-in @@ -3,7 +3,4 @@ usr/lib/xen-@version@/lib/python ? flavour = amd64 usr/lib/xen-@version@/boot -usr/lib/debug/usr/lib/xen-*/boot/* usr/lib/debug/xen-syms-@version@-shim -# ^ Yes, the upstream build system really does install the shim symbols -# file in debian/tmp/usr/lib/debug/usr/lib/xen-@version@/boot/xen-shim-syms ? -- 2.30.2